package com.probiz.estore.customer.service;

import com.probiz.estore.common.model.customer.Customer;
import com.probiz.estore.common.model.customer.ShopPoint;
import com.probiz.estore.core.service.GenericManager;


/**
 * ShopPoint Business Delegate (Proxy) Interface to handle communication between web and
 * persistence layer.
 * Developer introduced interfaces should be declared here. Won't get overwritten.
 *
 */
public interface ShopPointManager extends GenericManager<ShopPoint> {
	
	/**
	 * 更新客户积分基础入口
	 * @param customer 客户，更新后的积分可从customer.shopPoint.total获得
	 * @param point 要增加或减少的积分
	 * @param type 更新类型，参考ShopPoint类的积分类型 
	 * @param entity 发起更新的实体，参考ShopPoint类的积分类型,如果没有，填null即可,注意type和entity必须一致。
	 * @return 如果更新成功那么返回true，如果不能执行更新返回false 
	 * 返回false 一般是减扣积分，客户现有积分不能满足减少数量，则不能执行该操作，另外一种情况是要增加或减少的积分=0
	 */
	public boolean updateShopPoint(Customer customer, Integer point,Short type,Object entity,String description);
	/**
	 * 更新客户积分基础入口(省略了description)
	 * @param customer
	 * @param point
	 * @param type
	 * @param entity
	 * @return
	 */
	public boolean updateShopPoint(Customer customer, Integer point,Short type,Object entity);
	
}
